package karma.main;

import java.util.ArrayList;
import java.util.List;
import net.minecraft.src.*;

public class ItemAncientText extends Item
{
	public ItemAncientText(int i)
	{
		super(i);
		this.setMaxStackSize(1);
		setHasSubtypes(true);
		setMaxDamage(0);
	}	
	
	/*private String[] names = new String[]{"Scroll of Explosion", "Scroll of Lasers", "Scroll of Kill", "Scroll of Vampirism", "Scroll of Shadow", "Scroll of Murder", "Scroll of Day Burst", 
			"Scroll of Holy Beams", "Scroll of Healing", "Scroll of Solar Energy", "Scroll of Sunlight", "Scroll of Invincibility"};
	
	@Override
	public String getItemNameIS(ItemStack itemstack) {
		return names[itemstack.getItemDamage()];
	}*/
	
	public void addInformation(ItemStack itemstack, List list)
	{
		int i = itemstack.getItemDamage();
		if (i == 1)
		{
			list.add("Explosion");
		}
		if (i == 2)
		{
			list.add("Laser");
		}
		if (i == 3)
		{
			list.add("Instant Kill");
		}
		if (i == 4)
		{
			list.add("Vampirism");
		}
		if (i == 5)
		{
			list.add("Shadow");
		}
		if (i == 6)
		{
			list.add("Murder");
		}
		if (i == 7)
		{
			list.add("Day Burst");
		}
		if (i == 8)
		{
			list.add("Angel Rays");
		}
		if (i == 9)
		{
			list.add("Heal");
		}
		if (i == 10)
		{
			list.add("Solar Absorption");
		}
		if (i == 11)
		{
			list.add("Sunlight");
		}
		if (i == 12)
		{
			list.add("Invincibility");
		}
	}
	
	public boolean hasEffect(ItemStack itemstack)
	{
		int i = itemstack.getItemDamage();
		if (i == 0)
		{
			return false;
		}
		else
		{
			return true;
		}
	}
	
	public EnumRarity getRarity(ItemStack itemstack)
	{
		int i = itemstack.getItemDamage();
		if (i == 0)
		{
			return EnumRarity.common;
		}
		else
		{
			return mod_KarmaCraft.ENCHANTED;
		}
	}
	
	public void addCreativeItems(ArrayList arraylist)
    {
        arraylist.add(new ItemStack(this, 1, 0));
        arraylist.add(new ItemStack(this, 1, 1));
        arraylist.add(new ItemStack(this, 1, 2));
        arraylist.add(new ItemStack(this, 1, 3));
        arraylist.add(new ItemStack(this, 1, 4));
        arraylist.add(new ItemStack(this, 1, 5));
        arraylist.add(new ItemStack(this, 1, 6));
        arraylist.add(new ItemStack(this, 1, 7));
        arraylist.add(new ItemStack(this, 1, 8));
        arraylist.add(new ItemStack(this, 1, 9));
        arraylist.add(new ItemStack(this, 1, 10));
        arraylist.add(new ItemStack(this, 1, 11));
        arraylist.add(new ItemStack(this, 1, 12));
    }
	
	public static void randomize(EntityPlayer player, ItemStack itemstack)
	{
		if(itemstack.getItemDamage() == 0)
		{
			double rand = Math.random();
			int newdmg = (int)(rand * 12);
			newdmg ++;
			itemstack.setItemDamage(newdmg);
		}
	}
}
